package io;

import java.io.File;
import java.io.IOException;

public class demo01 {
    public static void main2(String[] args) throws IOException {
//        File f = new File("d:/demo.txt");
//        构造File对象的时候，写的路径，不一定非得真实存在
        File f = new File("./demo.txt");
        System.out.println(f.getParent());
        System.out.println(f.getName());
        System.out.println(f.getPath());
//        工作路径与相对路径简单的拼接
        System.out.println(f.getAbsolutePath());
//        化简AbsolutePath
        System.out.println(f.getCanonicalPath());
    }
}
